﻿using System;
using System.Collections.Generic;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Models
{
    public enum ConnectWay
    {
        Tcp,
        Com
    }
    public enum ComMessageMode
    {
        Hexadecimal,
        Ascill
    }

    [Serializable]
    public class DeviceConnMessage
    {
        /// <summary>
        /// 设备名称
        /// </summary>
        public string DeviceName { get; set; }
        /// <summary>
        ///连接方式
        /// </summary>
        public ConnectWay ConnMode { get; set; }
        /// <summary>
        //服务器IP
        /// </summary>
        public string ServerAdress { get; set; }
        /// <summary>
        ///服务器端口
        /// </summary>
        public int ServerPort { get; set; }
        /// <summary>
        //绑定地址
        /// </summary>
        public string BindAdress { get; set; }
        /// <summary>
        ///绑定端口
        /// </summary>
        public int BindPort { get; set; }
        /// <summary>
        /// Com信息
        /// </summary>
        public string PortName { get; set; }
        /// <summary>
        ///波特率
        /// </summary>
        public int BaudRate { get; set; }
        /// <summary>
        ///位长度
        /// </summary>
        public int DataBits { get; set; }
        /// <summary>
        ///奇偶校验
        /// </summary>
        public Parity Parity { get; set; }
        /// <summary>
        ///停止位
        /// </summary>
        public StopBits StopBits { get; set; }
        /// <summary>
        ///串口信息模式
        /// </summary>
        public ComMessageMode ComMessageMode { get; set; }
    }

}
